package recipe;

import java.util.ArrayList;

/**
 * Class - RecipeData
 * Description - Abstract representation of a recipe
 * 
 * @author Ryne Okimoto
 */

public class RecipeData {

	// Class data
	private String recipeName = null;
	private String imageFileName = null;
	private String category = null;

	// For first iteration
	// Ingredients and instructions are simple concatenated strings
	private String ingredients = null;
	private String instructions = null;
	private String stringOfTags = null;

	// Implement later for better program structure
	private ArrayList<String> listOfIngredients;
	private ArrayList<String> recipeInstructions;
	private ArrayList<String> tags;
	
	// Need to add units
	private static String[] listOfMetricUnits =
		{

		};
	private static String[] listOfStandardUnits =
		{
				
		};
	
	/**
	 * Default constructor
	 */
	public RecipeData(){
		recipeName = "";
		imageFileName = "";
		ingredients = "";
		instructions = "";
		category = "";
		stringOfTags ="";

	} // constructor
	
	/**
	 * Method - getRecipeName
	 * 
	 * Description - getter for recipeName
	 * 
	 * @return String
	 */
	public String getRecipeName(){
		return recipeName;
	}
	
	/**
	 * Method - setRecipeName
	 * 
	 * Description - setter for recipeName
	 * 
	 * @return void
	 */
	public void setRecipeName(String recipeName){
		this.recipeName = recipeName;
	}
	
	/**
	 * Method - getImageFileName
	 * 
	 * Description - getter for imageFileName
	 * 
	 * @return String
	 */
	public String getImageFileName(){
		return imageFileName;
	}
	
	/**
	 * Method - setImageFileName
	 * 
	 * Description - setter for imageFileName
	 * 
	 * @param imageFileName
	 */
	public void setImageFileName(String imageFileName){
		this.imageFileName = imageFileName;
	}
	
	/**
	 * Method - getCategory
	 * 
	 * Description - getter for category
	 * 
	 * @return String
	 */
	public String getCategory(){
		return this.category;
	}
	
	/**
	 * Method - setCategory
	 * 
	 * Description - setter for category
	 * 
	 * @param category
	 */
	public void setCategory(String category){
		this.category = category;
	}
	
	/**
	 * Method - getIngredients
	 * 
	 * Description - getter for ingredients
	 * 
	 * @return String
	 */
	public String getIngredients(){
		return ingredients;
	}
	
	/**
	 * Method - setIngredients
	 * 
	 * Description - setter for ingredients
	 * 
	 * @return void
	 * @param String
	 */
	public void setIngredients(String ingredients){
		this.ingredients = ingredients;
	}
	
	/**
	 * Method - getInstructions
	 * 
	 * Description - getter for instructions
	 * 
	 * @return String
	 */
	public String getInstructions(){
		return instructions;
	}
	
	/**
	 * Method - setInstructions
	 * 
	 * Description - setter for instructions
	 * 
	 * @return void
	 * @param String
	 */
	public void setInstructions(String instructions){
		this.instructions = instructions;
	}
	
	/**
	 * Method - getTags
	 * 
	 * Description - getter for tags
	 * 
	 * Notes - Initial implementation using a String not a list
	 * 
	 * @return String
	 */
	public String getTags(){
		return this.stringOfTags;
	}
	
	/**
	 * Method - setTags
	 * 
	 * Description - setter for tags
	 * 
	 * Notes - Initial implementation using a String
	 * 
	 * @param stringOfTags
	 */
	public void setTags(String stringOfTags){
		this.stringOfTags = stringOfTags;
	}
	
	/*
	 * cups
	 * tablespoons
	 * teaspoons
	 * 
	 * 1 cup = 8 fl oz
	 * 1 pint = 2 cups
	 * 1 quart = 2 pints
	 * 4 cups = 1 quart
	 * 1 gallon = 4 quarts
	 * 
	 * 16 oz = 1 lb
	 * ***********************
	 * 
	 * standard = metric
	 * 
	 * fluid oz = mL, multiply oz by 30 to get mL
	 * gal = L, multiply gal by 3.8 to get L
	 * qt = L, multiply qt by 0.9 to get L
	 * 
	 * oz = g, multiply oz by 28 to get g
	 * lb = kg, multiply by 0.45 to get kg
	 * 
	 */
	
	/**
	 * Private class for ingredients
	 */
	private static class Ingredient {
		// Ingredient attributes
		String ingredientName;
		String ingredientAmount;
		String ingredientUnit;
		boolean isMetric;
		boolean isModified;
		
		/**
		 * Default constructor for Ingredient class
		 */
		public Ingredient(){
			ingredientName = null;
			ingredientAmount = null;
			ingredientUnit = null;
			isMetric = false;
			isModified = false;
		} // constructor
		
		/**
		 * Overloaded constructor for Ingredient class
		 * 
		 * Description: Initializes data fields for Ingredient
		 *     Assumes all fields are correct
		 * @param name
		 * @param amount
		 * @param unit
		 * @param isMetric
		 */
		public Ingredient(String name, String amount, String unit, boolean isMetric){
			ingredientName = name;
			ingredientAmount = amount;
			ingredientUnit = unit;
			this.isMetric = isMetric; 
			isModified = false;
		} // constructor
	} // class Ingredient
	
	/**
	 * convertUnits
	 * 
	 * Description: Method to convert units from metric to standard and standard to metric
	 * @param none
	 * @return boolean
	 */
	public boolean convertUnits(){
		boolean conversionOK = false;
		
		return conversionOK;
	} // convertUnits
	
	/**
	 * Method - scaleAmount
	 *
	 * Description - 
	 *
	 */
	public boolean scaleAmount(int scaleFactor){
		boolean scaleOK = false;
		
		return scaleOK;
	} // scaleAmount
	
} // class
